﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using _1Dot9MasterBiz;
using System.Collections;
using System.Data;
using System.Data.SqlClient;

public partial class _Default : System.Web.UI.Page
{
    // 커넥팅
    protected SqlConnection Con;
    protected SqlCommand Cmd;

    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void btnSelect_Click(object sender, EventArgs e)
    {
        //Listing();
        GetPopupNotice();
    }

    #region GetPopupNotice - 공지사항 조회
    /// <summary>
    /// 공지사항 조회
    /// </summary>
    private void GetPopupNotice()
    {
        try
        {
            using (AdminBiz adminBiz = new AdminBiz())
            {
                string useYn = "Y"; //사용 여부

                Hashtable htParams = new Hashtable();
                htParams.Add("@P_USE_YN", useYn);

                DataSet ds = adminBiz.GetPopupNoticeView(htParams);

                TxtNotice.Text = ds.Tables[0].Rows[0]["NOTICE_CONTENTS"].ToString();
            }
        }
        catch (Exception ex)
        {
            TxtNotice.Text = ex.Message.ToString();
        }
    }
    #endregion

    // 커넥팅 함수 SAMPLE
    private void Listing()
    {
        string ConnectStr = "data source=thiagoms.cafe24.com;Database=thiagoms;User ID=thiagoms;Password=05en7690;";

        SqlConnection Con = new SqlConnection(ConnectStr);
        SqlCommand Cmd = new SqlCommand();
        Cmd.Connection = Con;
        Cmd.CommandText = "UP_PopupNotice_Select";
        Cmd.Parameters.Add("@P_USE_YN", SqlDbType.VarChar, 1);
        Cmd.Parameters["@P_USE_YN"].Value = "Y";
        Cmd.CommandType = CommandType.StoredProcedure;

        SqlDataAdapter adp = new SqlDataAdapter(Cmd);
        DataSet ds = new DataSet();

        adp.Fill(ds);

        TxtNotice.Text = ds.Tables[0].Rows[0]["NOTICE_CONTENTS"].ToString();
    }

}